package at.jku.cp.mir;

import java.util.Map;
import java.util.Set;

public class ArtistVectorOverlapScorSimilarity implements ArtistVectorSimilarity
{

	public double getSimilarity(ArtistVector aV1, ArtistVector aV2)
	{
		Map<String, Double> aV1Map = aV1.getTagTfIdfMap();
		Map<String, Double> aV2Map = aV2.getTagTfIdfMap();

		Set<String> aV1TagNames = aV1Map.keySet();
		int overlapScore = 0;
		for (String tagName : aV1TagNames)
		{
			if (aV2Map.containsKey(tagName))
				overlapScore++;
		}

		return overlapScore;
	}

}
